package com.example.spring.bean.load02scan;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试方法类
 * <p> 测试只扫描注册自己指定的bean
 * <p>
 */
public class CustomScanDemo {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(CustomConfig.class);

        String[] names = context.getBeanDefinitionNames();
        //除了系统组件，自己写的中，只有指定bean才被注入了，其余的没有被注入
        for (String name : names) {
            System.out.println(name);
        }

        //org.springframework.context.annotation.internalConfigurationAnnotationProcessor
        //org.springframework.context.annotation.internalAutowiredAnnotationProcessor
        //org.springframework.context.annotation.internalCommonAnnotationProcessor
        //org.springframework.context.event.internalEventListenerProcessor
        //org.springframework.context.event.internalEventListenerFactory
        //customConfig
        //scanRepository

        context.close();
        
    }
}

